/**
 * 
 */
package org.vsg.stock.basic.persistence;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import org.springframework.dao.DataAccessException;
import org.vsg.common.hibernate.GenericDao;
import org.vsg.stock.basic.domain.StockCategory;

/**
 * @author Bill Vison
 *
 */
public interface StockCategoryDao extends GenericDao{

	/**
	 * 
	 * @param entities
	 * @throws DataAccessException
	 */
	public void saveAll(Collection<StockCategory>  entities) throws DataAccessException;
	
	/**
	 * 
	 * @return
	 * @throws DataAccessException
	 */
	public List<StockCategory> findAllCategory() throws DataAccessException;
	
	/**
	 * 
	 * @return
	 * @throws DataAccessException
	 */
	public List<String> findAllDescription() throws DataAccessException;
	
	/**
	 * 
	 * @return
	 * @throws DataAccessException
	 */
	public List<String> findDescriptionByStockCode(String stockCode) throws DataAccessException;
	
	/**
	 * 
	 * @param name
	 * @return
	 * @throws DataAccessException
	 */
	public StockCategory getCategoryByName(String name) throws DataAccessException;
	
	/**
	 * clean table
	 * @throws DataAccessException
	 */
	public void cleanAll() throws DataAccessException;
	
	/**
	 * 
	 * @throws DataAccessException
	 */
	public void cleanAllAndMapping() throws DataAccessException;
	
	/**
	 * 
	 * @param categoryId
	 * @param stockCode
	 * @throws DataAccessException
	 */
	public void updateToStockInfoMapping(String cateDesc , String stockCode) throws DataAccessException;
	
	
	/**
	 * 
	 * @param cateStocksMap
	 * @throws DataAccessException
	 */
	public void updateBatchToStockInfoMapping(Map<String,List<String>> cateStocksMap) throws DataAccessException;
	
}
